/**
 * Project Name:dynamicDomain
 * File Name:DynamicAnalysisTask.java
 * Package Name:com.helper.domain.task
 * Date:2021年4月16日上午9:26:32
 * Copyright (c) 2021, hejiahua@szhuarong.com All Rights Reserved.
 *
*/

package com.helper.domain.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.helper.domain.config.DnsPodProperties;
import com.helper.domain.exception.CustomException;
import com.helper.domain.service.DynamicDomainService;

/**
 * ClassName:DynamicAnalysisTask <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason: TODO ADD REASON. <br/>
 * Date: 2021年4月16日 上午9:26:32 <br/>
 * 
 * @author hejiahua
 * @version
 * @see
 */

@Component
public class AutoRefrshDnsRecordTask {
	
	@Autowired
	DynamicDomainService dynamicDomainService;
	
	@Autowired
	DnsPodProperties dnsPodProperties;
	
	//固定60秒执行一次
	@Scheduled(cron = "0/10 * * * * ?") // 10秒一次
	public void recordModify() throws CustomException {
		dynamicDomainService.DNSRecordModify(dnsPodProperties.getQueryIPType());
	}
	
}
